<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*,com.book.model.*,com.book.formbean.*"  pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>查询首页</title>
	<%
BookPage bookPage=(BookPage)request.getAttribute("bookPage");
BookForm bookForm=(BookForm)request.getAttribute("bookForm");
Type type=(Type)request.getAttribute("type");

List<Book> books=bookPage.getBooks();
int bookCount=bookPage.getBookCount();
int pageNo=bookForm.getPageNo();
int pageSize=bookForm.getPageSize();
int booksSize=books.size();
int totalPageSize=0;
if(bookCount%pageSize==0){totalPageSize=bookCount/pageSize;}else{totalPageSize=bookCount/pageSize+1;}
%>
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"> 
	<script language="javascript">
	function forword()
	{
	    self.location='index.do?pageSize='+document.bookForm.pageSize.value+'&pageNo='+<%=pageNo+1%>+'&title='+getSelectedValue('title')+'&type='+getSelectedValue('type')+'&author='+getSelectedValue('author');
	}
	
	function backward()
	{
	    self.location='index.do?pageSize='+document.bookForm.pageSize.value+'&pageNo='+<%=pageNo-1%>+'&title='+getSelectedValue('title')+'&type='+getSelectedValue('type')+'&author='+getSelectedValue('author');
	}
	
	function getSelectedValue(name)
	{
	var obj=document.getElementById(name);
	return obj.value;
	}
	
	function search()
	{
		if(checkConditions())
		{
			document.getElementById("bookForm").submit();
		}
	}
	
	
	function checkConditions()
	{
		 
		return true;
	}
	
	</script>
	<link rel="stylesheet" type="text/css" href="resources/style/base.css" media="screen" />
</head>
<body>
<form:form  method="get" name="bookForm" id="bookForm" action="search.do"  commandName="bookForm">
	<div class="wrapper">
		<div class="header">
			<embed src="resources/flash/111.swf" width="1007" height="223"/>
		</div>
		<div class="nav">
		
		</div>
		<div class="main">
			<div class="searchbox f-l">	
				<table>
					<tr>
						<td><img src="resources/img/btn1a.gif" /></td>
						<td><input class="txt" type="text" id="title" name="title" /></td>
					</tr>
					<tr>
						<td><img src="resources/img/btn1b.gif" /></td>
						<td><input class="txt" type="text"  id="author" name="author"/></td>
					</tr>
					<tr>
						<td><img src="resources/img/btn1c.gif" /></td>
						<td>
							<form:select path="type1"  multiple="false"  class="txt">
								<form:option value="ALL" label="ALL"/>
								<form:options items="${type.type1s}"  itemValue="id" itemLabel="name"  />
							</form:select>
						</td>
					</tr>
					<tr>
						<td><img src="resources/img/btn1.gif" /></td>
						<td>
							<form:select path="type2"  multiple="false" class="txt">
								<form:option value="ALL" label="ALL"/>
								<form:options items="${type.type2s}"  itemValue="id" itemLabel="name"  />
							</form:select>
						</td>
					</tr>
					<tr>
						<td><img src="resources/img/btn1.gif" /></td>
						<td>
							<form:select path="type3"  multiple="false"  class="txt">
								<form:option value="ALL" label="ALL"/>
								<form:options items="${type.type3s}" itemValue="id" itemLabel="name" />
							</form:select>
						</td>
					</tr>
					<tr>
						<td></td>
						<td class="t-r"><a href="#"  onclick="document.getElementById('bookForm').submit();"><img src="resources/img/btn11.gif"/></a></td>
					</tr>
				</table>
			</div>			
			<div class="classify f-r">
				<ul>
					<li><a href="search.do?title=&author=&type1=1&type2=ALL&type3=ALL">བཀའབསྟན།</a></li>
					<li><a href="search.do?title=&author=&type1=2&type2=ALL&type3=ALL">རྙིང་མ།</a></li>
					<li><a href="search.do?title=&author=&type1=3&type2=ALL&type3=ALL">བཀའ་བདམས།</a></li>
					<li><a href="search.do?title=&author=&type1=4&type2=ALL&type3=ALL">ལམ་འབྲས།</a></li>
					<li><a href="search.do?title=&author=&type1=5&type2=ALL&type3=ALL">བཀའ་བརྒྱུད།</a></li>
					<li><a href="search.do?title=&author=&type1=6&type2=ALL&type3=ALL">ཤངས་པ།</a></li>
					<li><a href="search.do?title=&author=&type1=7&type2=ALL&type3=ALL">ཞི་བྱེད།</a></li>
					<li><a href="search.do?title=&author=&type1=8&type2=ALL&type3=ALL">བསྙེན་བསྒྲུབ།</a></li>
					<li><a href="search.do?title=&author=&type1=9&type2=ALL&type3=ALL">སྦྱོར་དྲུག</a></li>
					<li><a href="search.do?title=&author=&type1=10&type2=ALL&type3=ALL">ཆེད་བསྒྲིགས།</a></li>
					<li><a href="search.do?title=&author=&type1=11&type2=ALL&type3=ALL">གཡུང་དྲུང་བོན</a></li>
					<li><a href="search.do?title=&author=&type1=12&type2=ALL&type3=ALL">དམངས་ཁྲོད་རིག་གནས།</a></li>
					
					
					<li><a href="search.do?title=&author=&type1=13&type2=ALL&type3=ALL">སྒྲ་རིག་པ།</a></li>
					<li><a href="search.do?title=&author=&type1=14&type2=ALL&type3=ALL">ཚད་མ་རིག་པ།</a></li>
					<li><a href="search.do?title=&author=&type1=15&type2=ALL&type3=ALL">བཟོ་རིག་པ།</a></li>
					<li><a href="search.do?title=&author=&type1=16&type2=ALL&type3=ALL">གསོ་བ་རིག་པ།</a></li>
					<li><a href="search.do?title=&author=&type1=17&type2=ALL&type3=ALL">ནང་དོན་རིག་པ།</a></li>
					<li><a href="search.do?title=&author=&type1=18&type2=ALL&type3=ALL">སྙན་ངག།</a></li>
					<li><a href="search.do?title=&author=&type1=19&type2=ALL&type3=ALL">མངོན་བརྗོད།</a></li>
					<li><a href="search.do?title=&author=&type1=20&type2=ALL&type3=ALL">སྡེབ་སྦྱོར།</a></li>
					<li><a href="search.do?title=&author=&type1=21&type2=ALL&type3=ALL">ཟློས་གར།</a></li>
					<li><a href="search.do?title=&author=&type1=22&type2=ALL&type3=ALL">སྐར་རྩིས།</a></li>
					
					
					<li><a href="search.do?title=&author=&type1=23&type2=ALL&type3=ALL">ཐོན་མི།</a></li>
					<li><a href="search.do?title=&author=&type1=24&type2=ALL&type3=ALL">བཻ་རོ།</a></li>
				</ul>
			</div>
			
		</div>
		</form:form>
		<div class="show">
		
		</div>
		<div class="footer">
			<div class="classify">
				<ul>
					<li><a href="search.do?title=&author=&type1=25&type2=ALL&type3=ALL">སྐ་བ་དཔལ་བརྩེགས།</a></li>
					<li><a href="search.do?title=&author=&type1=26&type2=ALL&type3=ALL">ཅོག་རོ་ཀླུ་རྒྱལ།</a></li>
					<li><a href="search.do?title=&author=&type1=27&type2=ALL&type3=ALL">ཞང་ཡེ་ཤེས་སྡེ།</a></li>
					<li><a href="search.do?title=&author=&type1=28&type2=ALL&type3=ALL">ལོ་ཆེན་རིན་བཟང་།</a></li>
					<li><a href="search.do?title=&author=&type1=29&type2=ALL&type3=ALL">རྔོག་ལོ་ཆེན།</a></li>
					<li><a href="search.do?title=&author=&type1=30&type2=ALL&type3=ALL">ས་པཎ། </a></li>
					<li><a href="search.do?title=&author=&type1=31&type2=ALL&type3=ALL">བུ་སྟོན།</a></li>
					<li>
						<a href="#">分类一8</a>
					</li>
					<li>
						<a href="#">分类一1</a>
					</li>
					<li>
						<a href="#">分类一2</a>
					</li>
					<li>
						<a href="#">分类一3</a>
					</li>
					<li>
						<a href="#">分类一4</a>
					</li>
					<li>
						<a href="#">分类一1</a>
					</li>
					<li>
						<a href="#">分类一2</a>
					</li>
					<li>
						<a href="#">分类一3</a>
					</li>
					<li>
						<a href="#">分类一4</a>
					</li>
					<li>
						<a href="#">分类一5</a>
					</li>
					<li>
						<a href="#">分类一6</a>
					</li>
					<li>
						<a href="#">分类一7</a>
					</li>
					<li>
						<a href="#">分类一8</a>
					</li>
					<li>
						<a href="#">分类一1</a>
					</li>
					<li>
						<a href="#">分类一2</a>
					</li>
					<li>
						<a href="#">分类一3</a>
					</li>
					<li>
						<a href="#">分类一4</a>
					</li>
					<li>
						<a href="#">分类一5</a>
					</li>
					<li>
						<a href="#">分类一6</a>
					</li>
					<li>
						<a href="#">分类一7</a>
					</li>
					<li>
						<a href="#">分类一8</a>
					</li>
					<li>
						<a href="#">分类一1</a>
					</li>
					<li>
						<a href="#">分类一2</a>
					</li>
					<li>
						<a href="#">分类一3</a>
					</li>
					<li>
						<a href="#">分类一4</a>
					</li>
					<li>
						<a href="#">分类一5</a>
					</li>
					<li>
						<a href="#">分类一6</a>
					</li>
					<li>
						<a href="#">分类一7</a>
					</li>
					<li>
						<a href="#">分类一8</a>
					</li>
				</ul>
			</div>
		</div>
	</div>
</body>
</html>